$(function () {
    loadDeadData("香港");
})

//加载数据
function loadDeadData(name) {
    var pie_deadFive = echarts.init(document.getElementById("deadCount"), 'infographic');
    $.ajax({
        url:"../info/queryDeadCountByName",
        dataType:"json",
        type:"post",
        data:{"provinceName":name},
        success:function (data) {
            option = {
                tooltip : {
                    trigger: 'item',
                    formatter: "{b}: <br/>  {c} ({d}%)"
                },

                toolbox: {
                    show : false,
                    feature : {
                        mark : {show: true},
                        dataView : {show: true, readOnly: false},
                        magicType : {
                            show: true,
                            type: ['pie', 'funnel']
                        },
                        restore : {show: true},
                        saveAsImage : {show: true}
                    }
                },
                calculable : true,
                series : [

                    {
                        name:'各省死亡前五',
                        type:'pie',
                        color: ['#33b565', '#20cc98', '#20b9cf', '#2089cf', '#205bcf'],
                        radius : [20, 70],
                        center : ['50%', '50%'],
                        roseType : 'area',
                        data:data,
                    }
                ]
            };
            pie_deadFive.setOption(option);
        },error:function () {
            layer.alert("服务器错误");
        }
    })
}
function selectAreaByDead() {
    loadDeadData($("#deadArea").val());
}

